import { createRouter, createWebHistory } from 'vue-router'
import LayoutVue from '../views/LayoutView.vue'
import HomeView from '../views/HomeView/HomeView.vue'
import PlaceViewVue from '../views/PlaceView/PlaceView.vue'
import MineViewVue from '../views/MineView/MineView.vue'
import ShopViewVue from '../views/ShopView/ShopView.vue'
import PersonViewVue from '../views/PersonView/PersonView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: LayoutVue,
      children: [
          {
            path: '/',
            name: 'home',
            component: HomeView,
          },
          {
          path:"/place",
          name:"place",
          component:PlaceViewVue
          },
         {
          path:"/mine",
          name:"mine",
          component:MineViewVue
         },
         {
          path:"/shop",
          name:"shop",
          component:ShopViewVue
         },
        {
             path:"/person",
             name:"person",
             component:PersonViewVue
        },
        ]
    },
    {
        path:"/city",
        name:"city",
        component:()=>import('../views/HomeView/CityView.vue')
    },
    {
      path:"/beauty",
      name:"beauty",
      component:()=>import('../views/HomeView/BeautyView.vue')
    },
    {
      path:"/goodsDetails/:id",
      name:"goodsDetails",
     component:()=>import('../views/GoodsView/GoodsDetails.vue')
    },
    {
      path:"/commentList",
      name:"commentList",
      component:()=>import("../views/GoodsView/CommentListView.vue")
    },
    {
      path:"/placeDetails/:id",
      name:"placeDetails",
      component:()=>import("../views/PlaceView/PlaceViewDetails.vue")
    },
    {
      path:"/placeMap",
      name:"placeMap",
      component:()=>import("../views/PlaceView/PlaceMapView.vue")
    },
    {
      path:"/personDetails/:id",
      name:"personDetails",
      component:() => import("../views/PersonView/PersonDetailsView.vue")
    },
    {
      path:"/login",
      name:"login",
      component:() => import("../views/LoginView/LoginView.vue")
    },
    {
      path:"/register",
      name:"register",
      component:() => import("../views/LoginView/RegisterView.vue") 
    },
    {
      path:"/mineset",
      name:"mineset",
      component:() => import("../views/MineView/MineSetView.vue")
    },
    {
      path:"/mineaccount",
      name:"mineaccount",
      component:() => import("../views/MineView/MineAccountView.vue")
    },
    {
      path:"/minedata",
      name:"minedata",
      component:() => import("../views/MineView/MineDataView.vue")
    },
    {
      path:"/order:index",
      name:"order",
      component:() => import("../views/OrderView/OrderView.vue")
    },
    {
      path:"/pay/:id",
      name:"pay",
      component:() => import("../views/PayView/PayView.vue")
    }
  ],
})

export default router
